package cn.itcast.dtx.seatademo.bank1.service;

import cn.itcast.dtx.seatademo.bank1.dao.UserInfo;
import cn.itcast.dtx.seatademo.bank1.dao.OrderInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @Description :
 * @Author : guxuemin
 * @Version : V1.0.0
 * @Date : 2022/7/1 15:18
 */
@Service
public class TestOnlyTransService {

    @Resource
    private OrderInfo orderInfo;

    @Resource
    private UserInfo userInfo;

    @Transactional(rollbackFor = Exception.class)
    public void insertOrder() {
        orderInfo.insert();
    }

    @Transactional(rollbackFor = Exception.class)
    public void insertUser() {
        userInfo.insert();
    }
}
